<script setup>
// 评论
import { ref, defineProps } from 'vue'
const props = defineProps({
    headImg: {
        type: String,
        default: "/images/xk.jpg"
    },
    name: {
        type: String,
        default: "张三"
    },
    take: {
        type: String,
        default: "混合组件👀👀"
    },
    readTime: {
        type: String,
        default: "5 天前（8月22日）"
    },
    from: {
        type: String,
        default: "Vue3混合组件库搭建 实战篇"
    },
    url:{
        type:String,
        default:""
    }
})

</script>

<template>
    <div class="min-card3">
        <div class="m-title">
            <span>最新评论</span>
            <div>
                <p></p>
                <p></p>
            </div>
        </div>
        <div class="m-content">
            <li>
                <img class="m-head" :src="headImg" alt="">
                <div class="m-user">
                    <span class="name">{{ name }}</span>
                    <span class="take">{{ take }}</span>
                </div>
                <span class="read-time">{{ readTime }}</span>
            </li>
            <span class="read-more">{{ from }}</span>
        </div>
    </div>
</template>

<style lang="scss" scoped>
@keyframes cardIn {
    0% {
        transform: translate(0, -20%);
    }
    100% {
        transform: translate(0, 0);
    }
}
.min-card3 {
    padding: 16px;
    min-width: 220px;
    width: 250px;
    border-radius: 5px;
    box-shadow: 0 0 2px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    background-color: #fff;
    transition: all .3s;
    margin-bottom: 16px;
    animation:  cardIn .3s ease-in-out;

    .m-title {
        color: #777777;

        div {
            display: flex;
            align-items: center;
            justify-content: left;
            margin-bottom: 8px;

            :first-child {
                flex: 1;
                height: 3px;
                background-color: red;
                width: 60px;
                margin-top: 10px;
            }

            p:last-child {
                margin-top: 10px;
                flex: 3;
                height: 3px;
                border-bottom: 1px solid #999;
            }

        }

        span {
            font-size: 14px;
        }
    }

    .m-content {
        display: flex;
        justify-content: left;
        flex-direction: column;

        li {
            display: flex;
            // align-items: center;
            justify-content: left;
            cursor: pointer;
            font-size: 12px;

            .m-head {
                width: 40px;
                height: 40px;
                border-radius: 50%;
            }

            .m-user {
                margin-left: 10px;
                display: flex;
                flex-direction: column;
                align-items: left;
                justify-content: left;

                .name {
                    font-size: 14px;
                    color: #000;
                }

                .take {
                    max-height: 36px;
                    max-width: 80px;
                    font-size: 14px;
                    color: #868686;
                    overflow: hidden;
                }
            }

            .read-time {
                font-size: 12px;
                color: #999;
                margin-left: 10px;
                text-align: right;
            }
        }

        .read-more {
            font-size: 12px;
            color: #999;
            margin-top: 10px;
            text-align: left;
            cursor: pointer;

            &::before {
                font-size: 12px;
                content: '[文章]';
                color: #4e0a0a;
                margin-right: 5px;
            }
        }
    }

}
</style>